<%@ page import="org.apache.shiro.SecurityUtils" %>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="${pageContext.request.contextPath}/resources/plugins/h+/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>左边</title>
</head>
<body>
<!--左侧导航开始-->
        <nav class="navbar-default navbar-static-side" role="navigation">
            <div class="nav-close"><i class="fa fa-times-circle"></i>
            </div>
            <div class="sidebar-collapse">
                <ul class="nav" id="side-menu">
                    <li class="nav-header">
                        <div class="dropdown profile-element">
                            <span><img alt="image" class="img-circle" src="${pageContext.request.contextPath}/resources/plugins/h+/img/profile_small.jpg" /></span>
                            <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                <span class="clear">
                               <span class="block m-t-xs"><strong class="font-bold">刘员外</strong></span>
                                <span class="text-muted text-xs block">超级管理员<b class="caret"></b></span>
                                </span>

                            </a>
                            <ul class="dropdown-menu animated fadeInRight m-t-xs">
                                <li><a class="J_menuItem" href="${pageContext.request.contextPath}/home/toProfile.ac">个人资料</a>
                                </li>
                                <li><a class="J_menuItem" href="contacts.html">联系我们</a>
                                </li>
                                <li class="divider"></li>
                                <li><a href="login.html">安全退出</a>
                                </li>
                            </ul>
                        </div>
                        <div class="logo-element">久零
                        </div>
                    </li>
                    

                </ul>
            </div>
        </nav>
        <!--左侧导航结束-->
</body>
<script src="${pageContext.request.contextPath}/resources/plugins/h+/js/jquery.min.js?v=2.1.4"></script>
<script src="${pageContext.request.contextPath}/resources/plugins/h+/js/bootstrap.min.js?v=3.3.6"></script>
<script src="${pageContext.request.contextPath}/resources/plugins/h+/js/content.min.js?v=1.0.0"></script>
 <script src="${pageContext.request.contextPath}/resources/plugins/h+/js/plugins/sweetalert/sweetalert.min.js"></script>
<script type="text/javascript">
 		 $.ajax({
				url:'${pageContext.request.contextPath}/home/showLeftMenu.ac',
				type: 'post',
				async : false,
				success:function(data){
// 					var hrml_menu='<li><a href="#"><i class="fa fa-desktop"></i> <span class="nav-label">准备</span><span class="fa arrow"></span></a>'+
// 								'<ul class="nav nav-second-level">'+
// 								'<li><a class="J_menuItem" href="${pageContext.request.contextPath}/file/toFileManager.ac">文件管理器</a></li>'+
// 								'<li><a class="J_menuItem" href="empty_page.html">空白页</a></li>'+
// 								'</ul></li>';
					var json=eval(data);
					var ul = createTree(json,0);
					$("#side-menu").append(ul);
					$("#side-menu").listview("refresh");
					$("#side-menu").trigger("create");
				}
			});
			
			function createTree(data,id){
				if(data != null){
				 var ul='';
					 $.each(data, function(i,obj){  
					      if(obj.pid == id){
					      	ul+='<li><a href="#"><i class="'+obj.classIcon+'"></i> <span class="nav-label">'+obj.text+'</span><span class="fa arrow"></span></a>';
					      }else{
					      	ul+='<ul class="nav nav-second-level"> ';
					      	var href="${pageContext.request.contextPath}/"+obj.href;
					      	ul+="<li><a class='J_menuItem' href=\""+href+"\">"+obj.text+"</a></li>";
					      }
					      ul+='</ul>';
					      //createTree(data,obj.id);
					 });
					 ul+='</li>';
					 return ul;   
				}
				return null;
			}
			
</script>
</html>